package com.gdqy.FCS.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.dao.DesignDao;
import com.gdqy.FCS.entity.Design;

@Service
@Transactional
public class DesignService {
	@Autowired
	private DesignDao designDao;
	
	//设计师增加作品
	public int insert(Design design){
		return designDao.insert(design);
	}
	//设计师删除作品
	public int delete(Design design){
		
		return designDao.delete(design);
	}
	//设计师修改作品
	public int update(Design design){
		return designDao.update(design);
	}
	//转移专辑
	public int transferSpecial(int defaultSpecial_code,int originalSpecial_code ){
		return designDao.transferSpecial(defaultSpecial_code, originalSpecial_code);
	}
	//通过字典中type_code查找设计作品
	public List<Design> selectByType_code(String type_code){
		return designDao.selectByType_code(type_code);
	}
	//根据专辑id查找作品
	public List<Design> selectBySpecial_code(int special_code){
		return designDao.selectBySpecial_code(special_code);
	}
	//通过作品名查询作品 
	public List<Design> selectByName(String name){
		return designDao.selectByName(name);
	}
	//通过设计师id查询作品
	public List<Design> selectByDesigner_id(int designer_id){
		return designDao.selectByDesigner_id(designer_id);
	}
	//通过风格查询作品
	public List<Design> selectByStyle_code(String style_code){
		return designDao.selectByStyle_code(style_code);
	}
	//通过作品id查询作品
	public Design selectById(int id){
		return designDao.selectById(id);
	}
	public List<Design> selectByPattern_code(String pattern_code){
		return designDao.selectByPattern_code(pattern_code);
	}
	//查询设计师作品总数
	public int selectCountByDesignerId(int designer_id){
		return designDao.selectCountByDesignerId(designer_id);
	}
	//查询作品类型中按设计师喜欢数排序的设计师信息
	public List<Design> selectBy_type_code(String type_code){
		return designDao.selectBy_type_code(type_code);
	}
	//查询类似作品
	public List<Design> selectSimilarDesign(String type_code,String style_code,String pattern_code,String fabric_code,int id){
		return designDao.selectSimilarDesign(type_code, style_code, pattern_code, fabric_code,id);
	} 
	
	//通过面料编号拿到作品
	public  List<Design> selectByFabric_code(String fabric_code){
		return designDao.selectByFabric_code(fabric_code);
	}
	//查找匹配服装的设计作品
	public List<Design> selectMatchClothingDesign(String type_code,String pattern_code,String style_code){
		return designDao.selectMatchClothingDesign(type_code, pattern_code, style_code);
	}
	//查询所有作品总数
	public int selectAllCount(){
		return designDao.selectAllCount();
	}
	//按欢迎度查询设计师
	public List<Design> selectFab_designer(String big_code){
		return designDao.selectFab_designer(big_code);
	}
	//通过服装大类来查
	public List<Design> selectByBig_code(String big_code){
		return designDao.selectByBig_code(big_code);
	}
}
